const install = () => {
  uni.$u.http.interceptor.request = (config) => {
    const Authorization = uni.vk.getToken();

    if (Authorization) {
      config.header.Authorization = Authorization;
    }
    return config;
  };
  uni.$u.http.interceptor.response = (res) => {
    if (res.code === 200) {
      return res;
    }
    if (res.code === 401) {
      uni.vk.alert(res.msg, (e) => {
        uni.vk.navigateToLogin('');
      });
      return false
    }
    uni.vk.alert(res.msg)
    return res;
  };
};
export default install;

